package com.example.service;

import com.example.entity.StudioInfo;
import com.example.mapper.StudioInfoMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 工作室信息服务
 */
@Service
public class StudioInfoService {

    @Resource
    private StudioInfoMapper studioInfoMapper;

    /**
     * 新增工作室信息
     */
    public void add(StudioInfo studioInfo) {
        studioInfoMapper.insert(studioInfo);
    }

    /**
     * 更新工作室信息
     */
    public void update(StudioInfo studioInfo) {
        studioInfoMapper.update(studioInfo);
    }

    /**
     * 获取工作室信息
     */
    public StudioInfo getInfo() {
        List<StudioInfo> list = studioInfoMapper.selectAll();
        if (list != null && !list.isEmpty()) {
            return list.get(0);
        }
        return null;
    }
} 